[pallet-revive] EIP-7702 (continued)#12229
Conversation
…time_dev --bump patch'
|
/cmd prdoc --audience runtime_dev --bump major |
…time_dev --bump major'
|
/cmd bench --runtime asset-hub-westend --pallet pallet_revive |
|
Command "bench --runtime asset-hub-westend --pallet pallet_revive" has started 🚀 See logs here |
|
Command "bench --runtime asset-hub-westend --pallet pallet_revive" has failed ❌! See logs here |
…k into rve/eip-7702
|
/cmd bench --runtime asset-hub-westend --pallet pallet_revive |
|
Command "bench --runtime asset-hub-westend --pallet pallet_revive" has started 🚀 See logs here |
…t-hub-westend --pallet pallet_revive'
|
Command "bench --runtime asset-hub-westend --pallet pallet_revive" has finished ✅ See logs here DetailsSubweight results:
Command output:✅ Successful benchmarks of runtimes/pallets: |
|
All GitHub workflows were cancelled due to failure one of the required jobs. |
Continuation of #10851.
Implements EIP-7702 ("Set EOA Account Code") for
pallet-revive: an EOA can sign an authorization designating a contract whose code runs on its behalf, while using the EOA's own storage and balance. See #9569 for background.Changes
Pallet integration.
eth_callnow takes anauthorization_list(Vec<AuthorizationListEntry>) and processes it before the call. List size is bounded by gas: each entry must be covered byworst_case_delegation_deposit(), and an empty list on a type-4 tx is rejected ininto_call.Authorization processing.
process_authorizationsvalidates each entry (chain ID, signature, nonce, account type), creates the authority account if needed, and sets/clears the delegation. Invalid entries are silently skipped per spec; the function is otherwise fallible (e.g. insufficient funds for an account's ED). Delegation changes are applied outside the call's transactional context, so they persist even if the call reverts.Revive-specific cost. Per-authorization gas is higher than EVM: an entry may create a new account (needs ED), and delegating to a contract requires a code-lockup deposit plus a refcount bump on the code hash.
Storage. New
AccountType::DelegatedEOA { delegate_target: Option<H160>, contract_info: ContractInfo<T> }:EOA→DelegatedEOAis permanent; clearing only setsdelegate_target = None.storage_base_deposit(code-lockup portion) but keeps the child trie and per-item accounting.Execution.
Benchmarks.
process_new_account_authorization(n)(worst case) andprocess_existing_account_authorization(n)(best case, for weight refunds).RPC.
eth-rpccan submit and dry-run EIP-7702 txs;eth_getCodereturns the0xef0100 || addressprefix for delegated EOAs.Tests